﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _03.SequenceOfNumbers
{
    class sequenceOfNumbers
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Insert how many numbers you want to write");
            string number = Console.ReadLine();
            
            int biggest = int.MinValue,
                num,
                min = int.MaxValue;
            if (int.TryParse(number, out num))
            {
                for (int i = 1; i <=num; i++)
                {
                    Console.WriteLine("Insert {0} number",i);
                    int n = int.Parse(Console.ReadLine());
                    if (n > biggest)
                    {
                        biggest = n;
                    }
                    if (n < min)
                    {
                        min = n;
                    }

                }
            }
            else 
            {
                Console.WriteLine("Error!Insert a number!");
            }
            Console.WriteLine("The biggest number is {0}", biggest);
            Console.WriteLine("The smallest number is {0}", min);
        }
    }
}
